<template>
  <q-page class="tw-flex">
    <ModelDetail class="tw-w-full tw-h-full" model="triformer" />
  </q-page>
</template>

<script setup>
import { ref } from 'vue'

import ModelDetail from 'src/components/ModelDetail.vue';

let config = ref(null)
let data = ref(null)
fetch('/api/',{
  method:"POST",
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "method": "TrainError.GetConfig",
    "params": [],
  })
}).then(res=>res.json()).then(res=>{
  config.value = res.result
})
fetch('/api/',{
  method:'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body:JSON.stringify({
    "method": "TrainError.GetError",
    "params": [{"id":"1675761461"}]
  })
}).then(res=>res.json()).then(res=>{
  data.value = res.result['train_dict']
})


function ExtractData(data, key1, key2)
{
  let x = []
  let y = []
  for(let i=0;i<data.length;i++)
  {
    x.push(data[i][key1])
    y.push(data[i][key2])
  }
  return {'x':x,'y':y}
}

</script>
